import java.util.Scanner;

/**
 * Created by dllo on 18/4/3.
 */
public class Tese11 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入月份");
        int months = scanner.nextInt();
        System.out.println("输入日期");
        int days = scanner.nextInt();
        int sum = 0;
        switch (months) {
            case 12:
                sum = sum + 30;
            case 11:
                sum = sum + 31;
            case 10:
                sum = sum + 30;
            case 9:
                sum = sum + 31;
            case 8:
                sum = sum + 31;
            case 7:
                sum = sum + 30;
            case 6:
                sum = sum + 31;
            case 5:
                sum = sum + 30;
            case 4:
                sum = sum + 31;
            case 3:
                sum = sum + 28;
            case 2:
                sum = sum + 31;
            case 1:
                sum = sum+days;
                  break;
        }
        System.out.println(sum);
    }
}
